package com.oversea.util;

import java.lang.reflect.ParameterizedType;

public class Test2<T> {

	private Class<T> clazz;
	
	public Test2(){
		this.clazz = (Class<T>) ((ParameterizedType) getClass()
				.getGenericSuperclass()).getActualTypeArguments()[0];
	}
	@SuppressWarnings("unchecked")
	public void showType(){
		System.out.println(this.getClass());
		System.out.println(clazz.getName());
	}
	public void showValue(){
		//System.out.println(t);
	}
	
	public static void main(String[] s){
		Test2<String> test = new Test2<String>();
		test.showType();
		test.showValue();
	}
}
